package com.gjs.intranet.controller;


import com.gjs.common.manager.response.RspBody;
import com.gjs.intranet.pojo.dto.LibraryAttachQueryDTO;
import com.gjs.intranet.pojo.entity.LibraryAttach;
import com.gjs.intranet.service.ILibraryAttachService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 出版物附件表 前端控制器
 * </p>
 *
 * @author JC_Ho
 * @since 2022-04-11
 */
@RestController
@Slf4j
@Api(tags = "图书附件接口")
@RequiredArgsConstructor
@RequestMapping("/library/attach")
public class LibraryAttachController {

    private final ILibraryAttachService attachService;

    @GetMapping("/list")
    @ApiOperation("列表")
    public RspBody<List<LibraryAttach>> list(LibraryAttachQueryDTO queryDTO){
        List<LibraryAttach> attaches = attachService.list(attachService.buildWrapper(queryDTO));
        return RspBody.success(attaches);
    }
}
